package cn.ryh.globalexception.controller;

import cn.ryh.globalexception.exception.MyException;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @ClassName ExceptionDemo
 * @Description 异常Demo
 * @Author RaoYH
 * @Date 2018/10/30 16:17
 */
@Controller
@RequestMapping(value = "/exceptionDemo")
public class ExceptionController {

    @RequestMapping(value = "/testException")
    public Integer testException(){

        return 100 / 0;
    }
    @RequestMapping(value = "/testMyException")
    public void testMyException(){
        throw new MyException("测试");

    }
}
